<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" th:href="@{/css/qingzhu0.css}">
    <link rel="stylesheet" th:href="@{/css/register.css}">
    <link rel="stylesheet" th:href="@{/iconfont/iconfont.css}">
    <link rel="stylesheet" th:href="@{/css/qingzhu6.css}">
    <link rel="stylesheet" th:href="@{/css/common.css}">
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
</head>
<body>

<div th:replace="common::header"></div>
    <div class="outer7">
        <h4>注册</h4>
        <form class="layui-form" action="register.do" method="post">
            <div class="layui-form-item">
                <div class="div">
                    <input type="text" name="name" lay-verify="required">
                    <span id="s1">用户名</span>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="div">
                    <input type="password" name="password" lay-verify="required">
                    <span id="s2">设置密码</span>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="div">
                    <input type="password" id="repassword" lay-verify="required|confirm">
                    <span id="s3">确认密码</span>
                </div>
            </div>
            <div class="layui-form-item" style="display: none">
                <div class="div">
                    <input id="paypassword" name="paypassword" type="password" lay-verify="required" value="123456">
                    <span id="s4">支付密码</span>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="div">
                    <input type="text" id="phone" name="phone" lay-verify="required|phone">
                    <span id="s5">电话</span>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="div">
                    <input type="text" id="address" name="addr" lay-verify="required">
                    <span id="s6">地址</span>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="div">
                    <input type="text" id="email" name="email" lay-verify="required|email">
                    <span id="s7">邮箱</span>
                </div>
            </div>
            <div class="inter1">
                <span>已有账号，请</span><a th:href="@{/user/toLogin.html}">直接登录</a>
            </div>
            <div class="layui-form-item">
                <input lay-submit type="submit" value="注册" class="submit">
            </div>
        </form>
        <div>

        </div>
    </div>
    <div th:replace="common::footer"></div>
    <script th:src="@{/js/青竹注册.js}"></script>
    <script th:src="@{/js/jqurey.js}"></script>
    <script th:src="@{/js/shop.js}"></script>
</body>
<script th:src="@{/layui/layui.js}"></script>
<script>
    layui.use('form', function () {
        var form = layui.form;
        form.verify({
            confirm:function(value,item){
                if($('input[name=password]').val() !== value)
                    return '两次密码输入不一致！';
            }
        });
    });
    function checkUsername() {
        var username = $("input[name='username']").val();
        $.get("checkUsername.do?username=" + username, function (data) {
            if (!data.data) {
                layer.msg("用户已存在！");
                $("#submit").addClass("layui-btn-disabled");
            } else {
                $("#submit").removeClass("layui-btn-disabled");
            }
        });
    }
</script>
</html>